STEP 10: Let's make another dance move.
In drag out Wait . Drop it at the bottom of your program.
Go to and drag out Flip Right Left . Drop it at the bottom of your program.
We need to pause the stage before flipping, or the flip will happen too fast to see!
To navigate the page using the TAB key, first press ESC to exit the code editor.
stage.set_background("concert")
sprite = codesters.Sprite("person1")
sprite.set_speed(3)
sprite.move_down(100)
sprite.flip_up_down()
sprite.move_right(150)
sprite.move_left(200)
sprite.flip_up_down()
sprite.turn_left(360)
t = codesters.Teacher()
try:
tval1 = stage.get_total_wait_time()
except:
tval1 = "DNE"
try:
tval2 = sprite.get_flip()
except:
tval2 = "DNE"
try:
flips = t.find_text('flip_right_left')
tval3 = flips[0][0]
except:
tval3 = "DNE"
try:
waits = t.find_text('wait')
tval4 = waits[0][0]
except:
tval4 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 2, "Great Job!")
t1.add_failure(tval1 == 0, "Did you add a Wait command?")
t1.add_creative(tval1 != 1 and tval1 != 0 and tval1 != 2 and tval1 != "DNE", "That is a good wait time!")
t2 = TestObjective()
t2.add_success(tval2 == True and tval3 != "DNE", "Great Job!")
t2.add_failure(tval2 == False, "Did you add the new dance move?")
t2.add_failure(tval2 == True and tval3 == "DNE", "Did you use .flip_right_left()?")
t2.add_failure(tval2 == "DNE", "Did you delete the sprite?")
t3 = TestObjective()
t3.add_success(tval3 < tval4, "Great Job!")
t3.add_failure(tval4 > tval3, "Did you put .wait() before .flip_right_left()??")
tester = TestManager()
tester.add_test_list([t1, t2, t3])
tester.run_tests()
tester.display_first_feedback()
Run Code
Activity Submitted!
Submit Work
Next Activity
Stop Running Code
Show Chart
Show Console
Reset Code Editor
Codesters How To (opens in a new tab)